# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=asfa
pkgver=0.9.1
pkgrel=3
pkgdesc="Share files by uploading via SSH and generating a non-guessable link"
url="https://github.com/obreitwi/asfa"
# s390x: build failure
arch="all !s390x"
license="MIT OR Apache-2.0"
makedepends="
	cargo
	cargo-auditable
	libssh2-dev
	openssl-dev>3
	"
source="https://github.com/obreitwi/asfa/archive/v$pkgver/asfa-$pkgver.tar.gz
	strip-regex-features.patch
	"
options="!check"  # tests use docker

export CARGO_PROFILE_RELEASE_OPT_LEVEL="z"

export LIBSSH2_SYS_USE_PKG_CONFIG=1  # use system libssh2

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

package() {
	install -D -m755 target/release/$pkgname -t "$pkgdir"/usr/bin/
}

sha512sums="
ca42518793cb5c11e1ffc18066a0ee954dcba76a20b595ec17ba71ecff7e5a6967d8e5178ec3c8c93ae8a539ecd99f55ea5877680f21856be73391f47f59ac52  asfa-0.9.1.tar.gz
e3590cd7dc8a340d9bf8e63fca5bb252075e6dc8825ac510d0cfb088a4c0dcd65a65e2016a3409a1b95136aabadc4e5397e71413414ea9ad532d7a2f898c555d  strip-regex-features.patch
"
